package com.my.order.controller;

import com.my.common.Result;
import com.my.order.service.StockService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaodongchao
 * @date 2020/3/15 11:34
 **/
@RestController
public class OrderHandler {
    private final StockService stockService ;

    public OrderHandler(StockService stockService) {
        this.stockService = stockService;
    }

    @GetMapping("/getOrder/{id}")
    public Result getOrder(@PathVariable("id") Long id){
        return Result.ok(stockService.selectById(id));
    }
}
